<template>
  <div id="app">
    <router-view />
    
      <Main></Main>
      <!-- <router-link class="Router_Link" to="/HostRelease">
        <img src="@/assets/img/底部/发布-恢复的_06.png" alt />
        <p>
          <a href="./index2.html">发布</a>
        </p>
      </router-link>
      <router-link class="Router_Link" to="/HostCollection">
        <img src="@/assets/img/底部/发布-恢复的_10.png" alt />
        <p>
          <a href="./index3.html">收藏</a>
        </p>
      </router-link>
      <router-link class="Router_Link" to="/HostRelease">
        <img src="@/assets/img/底部/发布-恢复的_12.png" alt />
        <p>
          <a href="./index4.html">我的</a>
        </p>
      </router-link> -->
    
  </div>
</template>

<script>
import Main from './components/Main/Main.vue'


export default {
  name: "App",
  components:{
    Main,
    
  },
  created(){
    //   在页面加载时读取sessionStorage里的状态信息

if ( sessionStorage.getItem('state') ) {
  this.$store.replaceState( Object.assign( {}, this.$store.state,
  JSON.parse(sessionStorage.getItem('state') ) ) )
}

//   页面刷新时将state数据存储到sessionStorage中

window.addEventListener('beforeunload',()=>{
  sessionStorage.setItem('state',JSON.stringify(this.$store.state) )
})
  }
}
</script>

<style>


</style>
